package com.fxd.crm.web.controller.courseOrder;

import com.fxd.crm.model.CourseOrder;
import com.fxd.crm.model.curdResult;
import com.fxd.crm.service.ICourseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @auther fuxudong
 * @date 2021/4/3 - 14:04
 */
@Controller
@RequestMapping("/courseOrder")
public class CourseOrderController {

    @Autowired
    ICourseOrderService courseOrderImpl;

    @RequestMapping("list")
    public String list() {
        return "courseorder/list";
    }


    @RequestMapping("add")
    public String add() {
        return "courseorder/add";
    }

    @RequestMapping("edit")
    public String edit(Model model ,Integer order_id) {
        CourseOrder courseOrder = courseOrderImpl.findByOrderId(order_id);
        model.addAttribute("courseOrder", courseOrder);
        return "courseorder/edit";
    }

    @RequestMapping("detail")
    public String detail(Model model, Integer order_id) {
        CourseOrder courseOrder = courseOrderImpl.findByOrderId(order_id);
        model.addAttribute("courseOrder", courseOrder);
        return "courseorder/detail";
    }




}
